App({
  /*
  * 全局数据
  */
  globalData:{
    name:'哈哈',
    navigationBarHeight:0,
    screenHeight:0,
    windowHeight:0,
    isGetUserInfo:true,
    avatarUrl:'',
    nickName:''
  },
  /**
   * 当小程序初始化完成时，会触发 onLaunch（全局只触发一次）
   */
  onLaunch: function () {
    wx.removeStorageSync('item');
    var that = this;
    wx.getSystemInfo({
      success: function(res) {
        var x = 750 / res.removeStorageSync;
        that.globalData.navigationBarHeight = (res.statusBarHeight + 44) * 2;
        that.globalData.screenHeight = res.screenHeight * 2;
        that.globalData.windowHeight = res.windowHeight * 2;
      },
    });
    wx.getSetting({
      success(res) {
        if (res.authSetting['scope.userInfo']) {
          wx.getUserInfo({
            success(e) {
              that.globalData.isGetUserInfo = true;
              that.globalData.avatarUrl = e.userInfo.avatarUrl;
              that.globalData.nickName = e.userInfo.nickName;
              console.log(e);
            },
            fail(e) {
              console.log(e);
            }
          });
        } else {
          that.setData({
            isFirst: true
          })
        }
      }
    })
  },

  /**
   * 当小程序启动，或从后台进入前台显示，会触发 onShow
   */
  onShow: function (options) {
    
  },

  /**
   * 当小程序从前台进入后台，会触发 onHide
   */
  onHide: function () {
    
  },

  /**
   * 当小程序发生脚本错误，或者 api 调用失败时，会触发 onError 并带上错误信息
   */
  onError: function (msg) {
    
  },

  _acquireLoginInfo: function(e) {
  }
})
